float2 screenSize;

float radius;
float maxRadius;

bool change;

struct VertexShaderInput
{
    float4 Position : POSITION0;

    // TODO: add input channels such as texture
    // coordinates and vertex colors here.
};

struct VertexShaderOutput
{
    float4 Position : POSITION0;
	float4 CopyPosition : TEXCOORD0;

    // TODO: add vertex shader outputs such as colors and texture
    // coordinates here. These values will automatically be interpolated
    // over the triangle, and provided as input to your pixel shader.
};

VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
{
    VertexShaderOutput output;

    output.Position = input.Position;
    output.CopyPosition = input.Position;

    // TODO: add your vertex shader code here.

    return output;
}

float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{
    float2 pixelPosition = input.CopyPosition.xy * screenSize / 2 + screenSize / 2;

	//float blendFactor = saturate(distance(pixelPosition, screenSize / 2) / 130);
	//float blendFactor = saturate(length(input.CopyPosition.xy));


	float cosik = saturate(abs(distance(pixelPosition, screenSize / 2) - radius) / 3);

	//float color = abs(1 - distance(pixelPosition, screenSize / 2) / 130);

	float value = smoothstep(0, 1, 1 - cosik);

	if(value < 0.05f)
		return float4(0,0,0,0);
	else
		return float4(0, 0, value, (value / 2) * (1.0f - radius / maxRadius));
}

technique Technique1
{
    pass Pass1
    {
        // TODO: set renderstates here.

        VertexShader = compile vs_2_0 VertexShaderFunction();
        PixelShader = compile ps_2_0 PixelShaderFunction();
    }
}
